import collections
from typing import List


# """
# This is HtmlParser's API interface.
# You should not implement it, or speculate about its implementation
# """
class HtmlParser(object):
    def getUrls(self, url):
        """
        :type url: str
        :rtype List[str]
        """
        return [""]


class Solution:
    def crawl(self, startUrl: str, htmlParser: 'HtmlParser') -> List[str]:
        visited = {startUrl}
        queue = collections.deque([startUrl])
        host_name = 'http://' + startUrl.split('/')[2]

        while queue:
            now = queue.popleft()
            for new in htmlParser.getUrls(now):
                if new.startswith(host_name) and new not in visited:
                    queue.append(new)
                    visited.add(new)

        return list(visited)


if __name__ == "__main__":
    pass
